//
//  TYZComboBoxViewCell.m
//  DriveSchoolStudent
//
//  Created by TangBin on 2019/9/9.
//  Copyright © 2019 TangBin. All rights reserved.
//

#import "TYZComboBoxViewCell.h"

@interface TYZComboBoxViewCell ()
{
    CGFloat _cellWidth;
    
    CGFloat _cellHeight;
    
    UILabel *_titleLabel;
    
}
@property (nonatomic, strong) CALayer *line;

- (void)initWithTitleLabel;
@end

@implementation TYZComboBoxViewCell

- (void)initWithSubViewCell
{
    [super initWithSubViewCell];
    
    self.textLabel.textAlignment = NSTextAlignmentCenter;
}

- (void)initWithLine
{
    if (!_line)
    {
        CALayer *line = [CALayer layer];
        line.size = CGSizeMake(_cellWidth, 0.8);
        line.left = 0;
        line.bottom = _cellHeight;
        line.backgroundColor = [UIColor colorWithHexString:@"#e0e0e0"].CGColor;
        [self.layer addSublayer:line];
        self.line = line;
    }
}

- (void)initWithTitleLabel
{
    if (!_titleLabel)
    {
        // [UIImage imageNamed:@"btn_xialasanjiao"];
        
    }
}

- (void)updateCellData:(id)cellEntity cellWidth:(CGFloat)cellWidth cellHeight:(CGFloat)cellHeight
{
    _cellWidth = cellWidth;
    _cellHeight = cellHeight;
    
    [self initWithLine];
    
    self.textLabel.text = cellEntity;
}

@end
